USER_CONF=$(TOP)/obj/runtime.mk


CFLAGS_GLOBAL = $(CPPFLAGS_GLOBAL)
#CFLAGS_GLOBAL += -O2 -g -W -Wall -Wno-unused-parameter -fexceptions  -Werror
CFLAGS_GLOBAL += -g -W -Wall -Wno-unused-parameter -fexceptions

ASFLAGS_GLOBAL = $(CPPFLAGS_GLOBAL) -g

CFLAGS_GLOBAL += $(CFLAGS_COMMON_CONFIG)
ASFLAGS_GLOBAL += $(CFLAGS_COMMON_CONFIG)

include $(USER_CONF)

ifneq ($(findstring OCTEON, $(CHIP)), )
CC = mips64-octeon-linux-gnu-gcc
AR = mips64-octeon-linux-gnu-ar
LD = mips64-octeon-linux-gnu-ld
STRIP = mips64-octeon-linux-gnu-strip
OBJDUMP = mips64-octeon-linux-gnu-objdump
NM = mips64-octeon-linux-gnu-nm
else 
CC = gcc
AR = ar
LD = ld
STRIP = strip
OBJDUMP = objdump
NM = nm
endif

ifneq ($(findstring OCTEON, $(CHIP)), )
RUNTIME_FLAG += -DCHIP_OCTEON
endif

ifneq ($(findstring BCM, $(CHIP)), )
RUNTIME_FLAG += -DCHIP_BCM
endif

ifneq ($(findstring X86, $(CHIP)), )
RUNTIME_FLAG += -DCHIP_X86
endif

ifneq ($(findstring PCI, $(COMM)), )
RUNTIME_FLAG += -DCOMM_PCI
endif

ifneq ($(findstring POW, $(COMM)), )
RUNTIME_FLAG += -DCOMM_POW
endif

ifneq ($(findstring NET, $(COMM)), )
RUNTIME_FLAG += -DCOMM_NET
endif

ifneq ($(findstring LINUX, $(OS)), )
RUNTIME_FLAG += -DOS_LINUX
endif

ifneq ($(findstring WINDOWS, $(OS)), )
RUNTIME_FLAG += -DOS_WINDOWS
endif

OBJ_DIR = $(TOP)/build/obj$(PREFIX)
DYNLIB_DIR = $(TOP)/.libs

CFLAGS_GLOBAL += $(RUNTIME_FLAG)
#  standard compile line

COMPILE = $(CC) $(CFLAGS_GLOBAL) $(CFLAGS_LOCAL) -MD -c -o $@ $<
ASSEMBLE = $(CC) $(ASFLAGS_GLOBAL) $(ASFLAGS_LOCAL) -MD -c -o $@ $<

